package com.tnsw.noxnox.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.util.Log;

public class FragmentDialogBuilder extends DialogFragment {
	
	private String tag = "FragmentDialogBuilder";
	private Context context;
	private FragmentDialogInterface intf;
	
	public FragmentDialogBuilder() {
		
	}
	
	public void setInterface(FragmentDialogInterface intf) {
		this.intf = intf;
	}
	
	public FragmentDialogBuilder(Context context, FragmentDialogInterface intf) {
		this.context = context;
		this.intf = intf;
	}
	
	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		if (this.intf == null) {
			Log.w(tag, "Cannot create dialog, interface is null");
		} else {
			return(this.intf.onCreateDialog(savedInstanceState));
		}
		
		return(null);
	}
}
